package com.aizhixin.lab.project.course.entity;

import com.aizhixin.lab.project.template.entity.ProjectRole;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

@Data
@Entity(name = "c_project_module")
public class TeacherProjectModule {
    @Id
    @Column(name = "id")
    private String id;
    @Column(name = "project_id")
    private String projectId;
    @Column(name = "module_name")
    private String moduleName;
    @Column(name = "module_desc")
    private String moduleDesc;
    @Column(name = "module_level")
    private Integer moduleLevel;
    @Column(name = "suggest_time")
    private Float suggestTime;
    @Column(name = "module_no")
    private Integer moduleNo;
    @Column(name = "created_by")
    private Long createdBy;
    @Column(name = "created_date",insertable = false)
    private Date createdDate;
    @Column(name = "delete_flag")
    private Integer deleteFlag;
    @Column(name = "task_num")
    private Integer taskNum;
    @ManyToMany(fetch = FetchType.EAGER)
    @JsonIgnoreProperties(value = { "teacherProjectModuleList" })
    @JoinTable(name = "c_module_and_role",
            joinColumns = @JoinColumn(name = "module_id",referencedColumnName = "id"),
            inverseJoinColumns = @JoinColumn(name = "role_id",referencedColumnName = "id"))
    private List<ProjectRole> projectRoleList;
}
